Dynamic Typing in Polymorphic Languages
نویسندگان
چکیده
matching protects the identity of \hidden" representation types and prevents accidental matches in cases where several abstract types happen to have the same representation. On the other hand, transparent matching allows a more permissive style of programming, where a dynamically typed value of some abstract type is considered to be a value of a di erent version of \the same" abstract type. This exibility is critical in many situations. For example, a program may create disk les containing dynamic values, which should remain usable even after the program is recompiled, or two programs on di erent machines may want to exchange abstract data in the form of dynamically typed values. By viewing abstract types formally as existential types [17], we can see exactly where the di erence between these two solutions lies, and suggest a generalization of existential types that supports both. (Existential types can in turn be coded using universal types; with this coding, our design for dynamic types in the previous sections yields the second solution.) To add existential types to the variant of F de ned in the previous section, we extend the syntax of types and terms as in Figure 3.
منابع مشابه
Polymorphic Dynamic Typing
We study dynamic typing in continuation of Henglein’s dynamically typed λ-calculus, with particular regard to proof theoretic aspects and aspects of polymorphic completion inference. Dynamically typed λ-calculus provides a formal framework within which we can reason in a precise manner about properties of the process of completion for higher order programming languages. Completions arise from r...
متن کاملPolymorphic Game Semantics for Dynamic Binding
We present a game semantics for an expressive typing system for block-structured programs with late binding of variables and System F style polymorphism. As well as generic programs and abstract datatypes, this combination may be used to represent behaviour such as dynamic dispatch and method overriding. We give a denotational models for a hierarchy of programming languages based on our typing ...
متن کاملCombining Recursive and Dynamic Types
A denotational semantics of simply typed lambda calculus with a basic type Dynamic, modelling values whose type is to be inspected at run-time, has been given by Abadi e.a..1]. We extend this interpretation to cover (formally contractive) recursive types as well. Soundness of typing rules and freeness of run-time type errors for well-typed programs hold. The interpretation works also for implic...
متن کاملA Blame for All (revised)
Several programming languages are beginning to integrate static and dynamic typing, including Racket, Microsoft’s C# 4.0 (Hejlsberg 2010) and TypeScript (Hejlsberg, 2012), Facebook’s PHP (Verlaguet, 2013), and the research languages Sage (Gronski, Knowles, Tomb, Freund, and Flanagan, 2006) and Thorn (Wrigstad, Eugster, Field, Nystrom, and Vitek, 2009). However, an important open question remain...
متن کاملDynamic Typing in Polymorphic Languages Dynamic Typing in Polymorphic Languages Digital Equipment Corporation 1994
matching protects the identity of \hidden" representation types and prevents accidental matches in cases where several abstract types happen to have the same representation. On the other hand, transparent matching allows a more permissive style of programming, where a dynamically typed value of some abstract type is considered to be a value of a di erent version of \the same" abstract type. Thi...
متن کاملMolecular Typing of Mycobacterium Tuberculosis Isolated from Iranian Patients Using Highly Abundant Polymorphic GC-Rich-Repetitive Sequence
Background: Tuberculosis (TB) with more than 10 million new cases per year and one of the top 10 causes of death worldwide, is still one of the most important global health problems. Also, multi drug-resistant tuberculosis (MDR) is a serious danger to public health. Understanding of the epidemiological pattern of mycobacterium tuberculosis (MTB), Estimates of recent transmission and recurrence ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Funct. Program.
دوره 5 شماره
صفحات -
تاریخ انتشار 1995